(define-module (guixrus packages postmarketos)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages check)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages haskell-apps)
  #:use-module (gnu packages python-science)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages version-control)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix utils)
  #:use-module (guix build-system python))

(define-public pmbootstrap
  (package
    (name "pmbootstrap")
    (version "1.40.0")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pmbootstrap" version))
        (sha256
          (base32 "1cxycx0wcgs5lhsfisdrvbvhd46i2baz0r7iixzngqv98h8lvzvg"))))
    (build-system python-build-system)
    (arguments
     '(#:tests? #f ; TODO ModuleNotFoundError: No module named 'pmb_test'
       #:phases
       (modify-phases %standard-phases
         (replace 'check
           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
             (when tests?
               (add-installed-pythonpath inputs outputs)
               (invoke "pytest" "-vv" "./test/test_keys.py")))))))
    (native-inputs
      (list python-pytest python-pytest-cov python-flake8 
            shellcheck git sudo openssl))
    (propagated-inputs
      (list python-argcomplete))
    (home-page "https://gitlab.com/postmarketOS/pmbootstrap")
    (synopsis "Sophisticated tool to develop and install postmarketOS")
    (description
"@code{pmbootstrap} provides a sophisticated chroot/build/flash tool to
develop and install postmarketOS.")
    (license license:gpl3+)))
